<?php
/**
 * CreateTime: 2023/12/27 14:04
 * User:LinQ
 */

namespace App\Http\Controllers\Client;

use App\Http\Controllers\BasicInterfaceController;
use App\Http\Requests\Client\ClientRequest;
use App\Http\Requests\System\ListRequest;
use App\Http\Service\Client\ClientService;

class ClientController implements BasicInterfaceController
{

    public function getList()
    {
        $request = request()->only('page','page_size','filters','desc');
        (new ListRequest())->check($request);
        (new ClientService())->getList($request);
    }

    public function getSelect()
    {
        (new ClientService())->getSelect();
    }

    public function getSelectHasPage()
    {
        $request = request()->only('page','page_size','filters','desc');
        (new ListRequest())->check($request);
        (new ClientService())->getSelectHasPage($request);
    }

    public function getInfo($id)
    {
        (new ClientService())->getInfo($id);
    }

    public function create()
    {
        $request = request()->only('client_name','client_code');
        (new ClientRequest())->check($request);
        (new ClientService())->create($request);
    }

    public function fakeDelete($id)
    {
        (new ClientService())->fakeDelete($id);
    }

    public function delete()
    {

    }

    public function update($id)
    {
        $request = request()->only('client_name');
        $request['client_id'] = $id;
        (new ClientRequest())->scene('update')->check($request);
        (new ClientService())->update($request);
    }

    public function bindLawCaseTemp($id){
        $request = request()->only('client_temp_law_file_id','client_temp_law_not_sign_file_id');
        $request['client_id'] = $id;
        (new ClientService())->bindLawCaseTemp($request);
    }

    public function fakeDeleteByIds($ids)
    {

    }
}
